<?php
   
  $username = $vars['entity']->librarything_username;
  $key = $vars['entity']->librarything_key;
  if($username){
   
?>
    <div id="LT_widget">
    </div>
    <!-- http://www.librarything.com/api/json_books.php?userid=costelloc&key=1622143940&resultsets=books,bookreviews&limit=reviews&max=10&reviewmax=100&booksort=title -->
    <script type="text/javascript" src="http://www.librarything.com/api/json_books.php?userid=<?php echo $username; ?>&key=<?php echo $key; ?>&resultsets=books&booksort=random&max=5"></script>
<?php 
  } else {
        
    echo '<p>' . elgg_echo('librarything:notset') . '</p>';      
  }
?>
